package comday08.itheima01;


public class Demo02 {

    public static void main(String[] args) {
        //String类如何创建对象的？

        //把字符数组变成字符串
        char[] chs = {'a','b','c','d'};
        String s1 = new String(chs);
        System.out.println(s1);      //"abcd"

        //用字符串创建对象
        String s2 = new String("abcd");
        System.out.println(s2);     //"abcd"


        //简化方式
        String s3 = "abcd";
        System.out.println(s3);      //"abcd"

    }
}
